/*
 * CPPFile1.cpp
 *
 * Created: 11/19/2013 7:14:32 PM
 *  Author: brodzki
 */ 

#ifndef EAC_H_
#define EAC_H_

#include "Registers.h"

class EAC
{
	Registers port_;
	int line_;
public:
	EAC(Registers port, int line)	: port_(port), line_(line) {}
		
	void enable_pull_up()
	{
		*(port_.ddr.address) &= ~_BV(line_);
		*(port_.port.address) |= _BV(line_);
	}
	
	bool state()
	{
		return bit_is_set(*(port_.pin.address), line_);
	}
};

#endif // EAC_H_
